//
//  ViewController.m
//  JieMian
//
//  Created by 钟纪旺 on 16/4/19.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{

    NSArray *data;

}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor=[UIColor blueColor];
    //颜色
    data =@[@"      ",
            @"姓名   ",
            @"刘振霖",
            @"唐唐唐",
            @"廖梦诗",
            @"李尹卓",
            @"小鸭子",
            @"刘宏广",
            @"    ",
           
            ];
    UITableView *tableView =[[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    tableView.dataSource =self;
    
    [self.view addSubview:tableView];
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return data.count;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.textLabel.text = data[indexPath.row];
    return cell;
    }

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
